﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace MMITPinGen
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            lblMsg.Text = string.Empty;

            List<string> roles = Roles.GetRolesForUser(User.Identity.Name).ToList();
            string r = (from p in roles                   
                        select p).FirstOrDefault();

            switch (r)
            {
                case "Partner":
                    lnkFetchPINs.Visible = true;
                    break;
                case "MMIT Admin":
                    lnkGeneratePINs.Visible = true;
                    lnkManagePartner.Visible = true;
                    lnkUploadPINs.Visible = true;
                    break;

                default:
                    lblMsg.Text = "Please Login To Perform Functions of your Role";

                    break;
            }
                    
        }
    }
}
